package com.cty.tree;

public class BinarySortTreeDemo {
    public static void main(String[] args) {
        int[] arr = {7, 3, 10, 12, 5, 1, 9, 2};
        BinarySortTree binarySortTree = new BinarySortTree();
        for (int elem : arr) {
            binarySortTree.add(new Node(elem));
        }
        System.out.println("删除前~~");
        binarySortTree.midOrder();
        binarySortTree.delNode(5);
        binarySortTree.delNode(2);
        binarySortTree.delNode(9);
        binarySortTree.delNode(12);
       binarySortTree.delNode(7);
       binarySortTree.delNode(3);
       binarySortTree.delNode(1);
       binarySortTree.delNode(10);
        System.out.println("删除后~~");
        binarySortTree.midOrder();
    }
}
